package com.sy.dao.impl;

import com.sy.dao.UserDao;
import com.sy.entity.User;

import java.util.List;

public class UserDaoImpl extends AbstractDaoImpl implements UserDao {
    @Override
    public User getUserbyUserName(String userName) {
        return queryForObject("select * from t_user where name=?", User.class, userName);
    }

    @Override
    public boolean addUser(String userName, String userPwd) {
        return update("insert into t_user(name,pwd) values(?,?)", userName, userPwd);
    }

    @Override
    public List<User> getAllUsers() {
        return queryForList("select * from t_user", User.class);
    }

}
